pub mod admin;

use hypers::prelude::Response;
use once_cell::sync::Lazy;

static TERA: Lazy<tera::Tera> = Lazy::new(|| tera::Tera::new("views/**/*").unwrap());

pub fn render(path: &str, ctx: &tera::Context) -> Response {
    let mut body = Vec::with_capacity(1024);
    TERA.render_to(path, &ctx, &mut body).unwrap();
    let res = Response::default();
    res.status(200).html(body)
}
